package xyz.xtt.admin.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import xyz.xtt.admin.entity.TblAdminUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import xyz.xtt.admin.vo.AdminUserVo;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-11-21
 */

@Mapper
public interface AdminUserMapper extends BaseMapper<TblAdminUser> {

    @Select("select * from tbl_admin_user where user_name=#{username}")
    TblAdminUser getByName(String name);

    Page<AdminUserVo> userList(@Param("page")Page<AdminUserVo> AdminUserVo);


    @Update("UPDATE tbl_admin_user set status=#{status} where id= #{id}")
    boolean setStatus(Integer id, Integer status);

    boolean update(Integer id, String userName, String nickName, String password);
}
